import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
} from 'typeorm';

@Entity({ name: 'tb_role_permissions' })
export class RolePermission {
  @PrimaryGeneratedColumn('increment', {
    name: 'role_permission_id',
    type: 'bigint',
    comment: '角色权限ID 主键',
    primaryKeyConstraintName: 'role_permission_id',
  })
  role_permission_id: number;

  @Column({
    name: 'role_id',
    type: 'bigint',
    comment: '角色ID',
    foreignKeyConstraintName: 'role_id',
  })
  role_id: number;

  @Column({
    name: 'permission_id',
    type: 'bigint',
    comment: '权限ID',
    foreignKeyConstraintName: 'permission_id',
  })
  permission_id: number;

  @CreateDateColumn({
    name: 'created_at',
    type: 'timestamp',
    comment: '创建时间',
  })
  created_at: number;
}
